﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 玩具商城管理系统.znew
{
    public partial class Nwuliuinformation : Form
    {
        public Nwuliuinformation()
        {
            InitializeComponent();
        }

        private void Nwuliuinformation_Load(object sender, EventArgs e)
        {
            DB.GetCn();
            string str;
            if (Nwuliu.Commodityid != "" || Nwuliu.orderid != "")
            {

                str = "select * from hot where hot_commodityname= '" + Nwuliu.Commodityid + "' and orderT_id= " + Nwuliu.orderid + " and hot_clientname='" + login.username + "'";
            }
            else
            {
                str = "select * from hot where hot_commodityname= " + Nwuliu.Commodityid + " and orderT_id= " + Nwuliu.orderid + " and hot_clientname='" + login.username + "'";

            }
            DataTable dt = DB.GetDataSet(str);
            label2.Text = dt.Rows[0][14].ToString();
            label3.Text = dt.Rows[0][15].ToString();
            label4.Text = dt.Rows[0][16].ToString();
            label9.Text = dt.Rows[0][1].ToString();
            if (label2.Text != "")
            {
                button2.Visible= false;
                label1.Text = "商品已出货";
                label2.Visible = true;
                label5.Visible = true;
                pictureBox6.Visible=true;
                pictureBox2.Visible = true;
                pictureBox10.Visible = false;

            }
            if (label3.Text != "")
            {
                label2.Visible = true;
                label5.Visible = false;
                pictureBox2.Visible = true;
                pictureBox6.Visible = true;
                pictureBox7.Visible=true;
                label3.Visible = true;
                label6.Visible = true;
                pictureBox3.Visible = true;
            }
            if (label4.Text != "")
            {
                label2.Visible = true;
                label5.Visible = false;
                pictureBox2.Visible = true;
                label3.Visible = true;
                label6.Visible = false;
                pictureBox3.Visible = true;
                label4.Visible = true;
                pictureBox6.Visible = true;
                pictureBox7.Visible = true;
                pictureBox8.Visible = true;
                label7.Visible = true;
                pictureBox4.Visible = true;
            }
            DB.cn.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("已经向商家催发货");
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
